<%@page import="com.dfhc.util.CryptoHelper"%>
<%@page import="com.dfhc.util.StringHelper"%>
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<!-- 全局js 和css包 -->
<%@ include file="/jsp/include/web/new/global.jsp" %>
<title>添加rm_authorize </title>

<%@ taglib uri="/dfhc" prefix="dfhc" %>
</head>
<body>


<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-rmauthorize-add">
	   <input type="hidden" id="id" name="id" value="${bean.id}">
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title_2">名称：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_label_div">	        
			<dfhc:input templateId="h_ui_input" value="${bean.name}" placeholder="" id="name" name="name"/>			
	    </dfhc:div>	 
	    </dfhc:div>	    		 
		<dfhc:div templateId="h_ui_div_row_cl">					
	    <dfhc:title templateId="h_ui_label_title_2">业务关键字：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_label_div">	        
			<dfhc:input templateId="h_ui_input" value="${bean.bs_keyword}" placeholder="" id="bs_keyword" name="bs_keyword"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title_2">是否单独建表：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_label_div">
				<dfhc:select templateId="h_ui_select" size="1" name="is_alone_table" id="is_alone_table" pleaseSelect="1" defaultValue="${bean.is_alone_table}" sqlOption="code" code="RM_YES_NOT" />				
			</dfhc:div>
		</dfhc:div>
		<dfhc:div templateId="h_ui_div_row_cl">					
	    <dfhc:title templateId="h_ui_label_title_2">授权资源表名：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_label_div">	        
			<dfhc:input templateId="h_ui_input" value="${bean.authorize_resource_table_name}" placeholder="" id="authorize_resource_table_name" name="authorize_resource_table_name"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title_2">授权记录表名：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_label_div">	        
			<dfhc:input templateId="h_ui_input" value="${bean.authorize_resrec_table_name}" placeholder="" id="authorize_resrec_table_name" name="authorize_resrec_table_name"/>			
	    </dfhc:div>	 
	    </dfhc:div>	    		 
		<dfhc:div templateId="h_ui_div_row_cl">					
	    <dfhc:title templateId="h_ui_label_title_2">授权资源附加数据表名：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_label_div">	        
			<dfhc:input templateId="h_ui_input" value="${bean.authorize_affix_table_name}" placeholder="" id="authorize_affix_table_name" name="authorize_affix_table_name"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title_2">权限配置选项类型：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_label_div">
				<dfhc:select templateId="h_ui_select" size="1" name="settiing_option" id="settiing_option" pleaseSelect="1" defaultValue="${bean.settiing_option}" sqlOption="code" code="RM_OPTION_TYPE" />				
			</dfhc:div>
		</dfhc:div>
		<dfhc:div templateId="h_ui_div_row_cl">
			<dfhc:title templateId="h_ui_label_title">定制代码：</dfhc:title>
			<dfhc:div templateId="h_ui_div_fromcontrol">			    
				<dfhc:textarea name="custom_code" id="custom_code" cols="" rows=""   placeholder="说点什么...最少输入10个字符" maxlength="4000" templateId="h_ui_textarea" >${bean.custom_code}</dfhc:textarea>				
			</dfhc:div>
		</dfhc:div>
	    <dfhc:div templateId="h_ui_div_row_cl">
		    <dfhc:title templateId="h_ui_label_title_2">描述：</dfhc:title>	    
		    <dfhc:div templateId="h_ui_div_label_div">
		    	<dfhc:textarea name="description" cols="" rows=""   placeholder="说点什么...最少输入10个字符" maxlength="1000" templateId="h_ui_textarea" >${bean.description}</dfhc:textarea>	        							
		    </dfhc:div>
	    </dfhc:div>	    		 
		<dfhc:div templateId="h_ui_div_row_cl">
			<dfhc:div templateId="h_ui_div_pop_up_button2">
				<dfhc:button templateId="h_ui_submit_button" />
			</dfhc:div>
		</dfhc:div>
	</form>
</article>



<script type="text/javascript">
$(function(){
	//获取新id
	<c:if test="${empty bean}"> 
	$('#id').val(getNewId('rm_authorize'));
	</c:if>


	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-rmauthorize-add").validate({
		rules:{
			name:{			
				required:true,
				minlength:1,
				maxlength:200
			},
			bsKeyword:{			
				required:true,
				minlength:1,
				maxlength:200
			},
			isAloneTable:{			
				required:true,
				minlength:1,
				maxlength:1
			},
			authorizeResourceTableName:{			
				maxlength:50
			},
			authorizeResrecTableName:{			
				maxlength:50
			},
			authorizeAffixTableName:{			
				maxlength:50
			},
			settiingOption:{			
				maxlength:1
			},
			customCode:{			
				maxlength:4000
			},
			description:{			
				maxlength:1000
			},
			usableStatus:{			
				maxlength:1
			},
			modifyDate:{			
			},
			modifyIp:{			
				maxlength:45
			},
			constraint:{			
			}
		},
 		messages: {
			name:{
		        required: "请输入NAME",
		        minlength: "NAME至少由1个字母组成",
		        maxlength: "NAME最大长度为200个字母"
	           },
			bsKeyword:{
		        required: "请输入BS_KEYWORD",
		        minlength: "BS_KEYWORD至少由1个字母组成",
		        maxlength: "BS_KEYWORD最大长度为200个字母"
	           },
			isAloneTable:{
		        required: "请输入IS_ALONE_TABLE",
		        minlength: "IS_ALONE_TABLE至少由1个字母组成",
		        maxlength: "IS_ALONE_TABLE最大长度为1个字母"
	           },
			authorizeResourceTableName:{
		        maxlength: "AUTHORIZE_RESOURCE_TABLE_NAME最大长度为50个字母"
	           },
			authorizeResrecTableName:{
		        maxlength: "AUTHORIZE_RESREC_TABLE_NAME最大长度为50个字母"
	           },
			authorizeAffixTableName:{
		        maxlength: "AUTHORIZE_AFFIX_TABLE_NAME最大长度为50个字母"
	           },
			settiingOption:{
		        maxlength: "SETTIING_OPTION最大长度为1个字母"
	           },
			customCode:{
		        maxlength: "CUSTOM_CODE最大长度为4000个字母"
	           },
			description:{
		        maxlength: "DESCRIPTION最大长度为1000个字母"
	           },
			usableStatus:{
		        maxlength: "USABLE_STATUS最大长度为1个字母"
	           },
			modifyDate:{
	           },
			modifyIp:{
		        maxlength: "MODIFY_IP最大长度为45个字母"
	           },
			constraint:{
	           }
	    },		
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			<c:if test="${empty bean}"> 
			var url = getRootPath()+'<%=CryptoHelper.encryptUrl(request,"/rmauthorize/insert")%>';
			</c:if>
			<c:if test="${not empty bean}"> 
			var url = getRootPath()+'<%=CryptoHelper.encryptUrl(request,"/rmauthorize/update")%>';
			</c:if>
			//提交成功关闭
			//将<,>替换为中文《,》
			var custom_code =$("#custom_code").val();
			custom_code = custom_code.replace(/</g,"《");
			custom_code = custom_code.replace(/>/g,"》");
			$("#custom_code").val(custom_code);
			var parameter =$("#form-rmauthorize-add").serialize();
			submitAjax(url,parameter,"rmauthorize"); 		    		    		
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
